#include <QtGui>
#include "qmlapplicationviewer.h"
#include <QDeclarativeContext>
#include "box2dplugin.h"

#ifndef QT_NO_OPENGL
#include <QGLWidget>
#endif


int main(int argc, char *argv[])
{
    QApplication::setGraphicsSystem("raster");
    QApplication app(argc, argv);
    QmlApplicationViewer viewer;

    /*OS specific screen sizes*/
#if defined Q_WS_MAEMO_5
    QRect screenGeometry(0, 0, 800, 480);
#elif defined Q_OS_SYMBIAN
    QRect screenGeometry(0, 0, 640, 360);
#else
    QRect screenGeometry(100, 100, 800, 480);
#endif

    /*Graphics Plugin*/
    Box2DPlugin plugin;
    plugin.registerTypes("Box2D");


    /*Screen width and height for use in qml*/
    QDeclarativeContext *context = viewer.rootContext();
    context->setContextProperty("screenWidth", screenGeometry.width());
    context->setContextProperty("screenHeight", screenGeometry.height());

    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setMainQmlFile(QLatin1String("qml/demolition/main.qml"));
//	viewer.setMainQmlFile(QLatin1String("qml/demolition/test.qml"));







    viewer.setGeometry(screenGeometry);

#if defined Q_WS_MAEMO_5
    viewer.showFullScreen();
#else
    viewer.showExpanded();
#endif

    return app.exec();
}
